package com.cityp.bean;

import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.Collection;

/**
 * @ClassName: AllUser
 * @Description:
 * @author: Kowk
 * @since:1.0.0
 */

@Data
public class AllUser implements Serializable, UserDetails {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "user_id")
    private String UserId;

    private String UserName;

    private String UserFirst;

    private String UserLast;

    private String UserSex;

    private int UserAge;

    private String UserJob;

    private String UserPhone;

    private String UserEmail;

    private int UserPostcode;

    private String UserPassword;

    private String UserAddress;

    private int UserState;

    private Timestamp UserCreatTime;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return this.UserPassword;
    }

    @Override
    public String getUsername() {
        return this.UserName;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        if(this.UserState==1)
        return true;
        return false;
    }
}
